package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._0._3工厂;

/**
 * @ClassName Test0_3
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 7:36 PM
 * @Version 1.0
 */
public class Test0_3 {
    public static void main(String[] args) {
        Animal[] arrayAnimal=new Animal[10];
        int index=0;
        arrayAnimal[0] = AnimalFactory.createAnimal("猫","小花",1);
        arrayAnimal[1] = AnimalFactory.createAnimal("狗","阿毛",2);
        arrayAnimal[2] = AnimalFactory.createAnimal("狗","小黑",3);
        arrayAnimal[3] = AnimalFactory.createAnimal("猫","娇娇",4);
        arrayAnimal[4] = AnimalFactory.createAnimal("猫","咪咪",5);
        for(int i=0;i<5;i++){
            System.out.println(arrayAnimal[i].shout());
        }
    }
}
